home *** CD-ROM | disk | FTP | other *** search
- #include "program globals.h"
- #include "graphics.h"
- #include "generic open.h"
- #include "kant load-save.h"
- #include "kant text twiddling.h"
- #include "environment.h"
- #include "dialogs.h"
- #include "error.h"
- #include "print meat.h"
-
- void OpenTheFile(FSSpec *myFSS)
- {
- switch (GetFileType(myFSS))
- {
- case SAVE_TYPE:
- if (!GetIndWindowPtr(kMainWindow))
- {
- saveFile=*myFSS;
- GetTheFile(&saveFile);
- gNeedToOpenWindow=FALSE;
- }
- else
- {
- PositionDialog('ALRT', smallAlert);
- ParamText("\pPlease close the current text before opening another.","\p","\p","\p");
- StopAlert(smallAlert, 0L);
- }
- break;
- }
- }
-
- void PrintTheFile(FSSpec *myFSS)
- {
- switch (GetFileType(myFSS))
- {
- case SAVE_TYPE:
- if (!GetIndWindowPtr(kMainWindow))
- {
- GetTheFile(myFSS);
- PrintText(GetTheTextHandle());
- CloseTheIndWindow(kMainWindow);
- }
- else
- {
- PositionDialog('ALRT', smallAlert);
- ParamText("\pPlease close the current text before printing.","\p","\p","\p");
- StopAlert(smallAlert, 0L);
- }
- break;
- }
- }
-
- OSType GetFileType(FSSpec *myFSS)
- {
- HParamBlockRec paramBlock;
-
- paramBlock.fileParam.ioCompletion=0L;
- paramBlock.fileParam.ioNamePtr=myFSS->name;
- paramBlock.fileParam.ioVRefNum=myFSS->vRefNum;
- paramBlock.fileParam.ioFDirIndex=0;
- paramBlock.fileParam.ioDirID=myFSS->parID;
- PBHGetFInfo(¶mBlock, FALSE);
-
- return paramBlock.fileParam.ioFlFndrInfo.fdType;
- }
-